package com.spring.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import com.spring.model.User;
import com.spring.service.inf.ScimApi;
import com.spring.util.yml.OwnUsers;

/**
 * Application启动完成后执行
 * 
 * @author user
 *
 */
@Component
public class JDDRunner implements ApplicationRunner {

	@Autowired
	private OwnUsers ownUsers;
	
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
	@Autowired
	private ScimApi scimApi;

	@Override
	public void run(ApplicationArguments args) throws Exception {
		System.out.println(scimApi.getUser());
		System.out.println("这个是测试ApplicationRunner接口");
		redisTemplate.opsForValue().set("startTime",System.nanoTime());
		for (User user : ownUsers.getUsers()) {
			System.out.println(user);
		}

	}
}
